package com.ecommerce.dal.common;

import java.util.List;

import com.ecommerce.dal.entity.Communication;
import com.ecommerce.dal.service.impl.CommunicationManagerService;

public class TestCommunication {
	public TestCommunication(CommunicationManagerService communicationManagerService){

		/** insert **/
		
		Communication communication = new Communication();
		//company.setCompanyId(1L);
		communication.setCommunicationType("phone".toLowerCase());
		communicationManagerService.saveCommunication(communication);
		
		/** select **/
    	Communication communication2 = communicationManagerService.retrieveCommunication(1);
    	System.out.println(communication2.getCommunicationType());
    	
    	List<Communication> communicationList = communicationManagerService.retrieveAllCommunications();
    	for(Communication communicationX : communicationList){
    		System.out.println("Communication Id: "+communicationX.getCommunicationId() + " ,  Communication Type: "+communicationX.getCommunicationType());
    	}
    	
//    	/** update **/
//    	communication2.setCommunicationType("Address".toLowerCase());
//    	communicationManagerService.updateCommunication(communication2);
//    	System.out.println(communication2);
//    	

    	/** delete **/
//    	communicationManagerService.delete(communication2);
    	
    	System.out.println("Done");
	}

	

}
